import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: "hash",
  routes: [
    {
      path: '/',
      redirect: '/regist'
    },
    {
      // 登录
      path: '/login',
      component: resolve => require(['../components/pages/login.vue'], resolve),
    },
     {
      // 注册
      path: '/regist',
      component: resolve => require(['../components/pages/regist.vue'], resolve),
    },
    {
      // 首页
      path: '/index',
      component: resolve => require(['../components/common/home.vue'], resolve),
      children: [{
          path: '/',
          component: resolve => require(['../components/pages/index.vue'], resolve),
        }
      ]
    },
    {
      // 详情页
      path: '/detail',
      component: resolve => require(['../components/pages/detail.vue'], resolve)
    },
    {
      // 分类
      path: '/class',
      component: resolve => require(['../components/common/home.vue'], resolve),
      children: [{
          path: '/class',
          component: resolve => require(['../components/pages/class.vue'], resolve),
        },{
          path: '/appupload',
          component: resolve => require(['../components/pages/uploadapp.vue'], resolve),
        }
      ]
    },
    {
      path: '/applist',
      component: resolve => require(['../components/pages/applist.vue'], resolve),
    },
    {
      // 排行
      path: '/rank',
      component: resolve => require(['../components/common/home.vue'], resolve),
      children: [{
          path: '/rank',
          component: resolve => require(['../components/pages/rank.vue'], resolve),
        }
      ]
    },
    {
      // 游戏
      path: '/game',
      component: resolve => require(['../components/common/home.vue'], resolve),
      children: [{
          path: '/game',
          component: resolve => require(['../components/pages/game.vue'], resolve),
        }
      ]
    },
    {
      // 公告页
      path: '/notice',
      component: resolve => require(['../components/pages/notice.vue'], resolve)
    },
    {
      // 我的
      path: '/mine',
      component: resolve => require(['../components/common/home.vue'], resolve),
      children: [{
          path: '/mine',
          component: resolve => require(['../components/pages/mine.vue'], resolve),
        }
      ]
    },
    {
      // 密码修改
      path: '/passwordreset',
      component: resolve => require(['../components/pages/passwordreset.vue'], resolve)
    },
    {
      // 关于我们
      path: '/about-us',
      component: resolve => require(['../components/pages/aboutus.vue'], resolve)
    }
  ]
})
